package com.doeis.uwork.entity.mongo;

import java.sql.Timestamp;

import com.voland.core.annotation.Table;
import com.voland.core.db.Entity;


/**
 * mina 发包和收报进行监控
 * @author tianbx
 */
@Table(name="mina_packet_log")
public class MinaPacketLog extends Entity  {

		private String id;
	    // 数据包类型,这里为枚举类型，枚举类型在发送时，占用一个byte的大小
		private int packetType;   
		
		// 协议版本,占用一个字节
		private int version;
		
		// 数据包发送方向，占用一个字节
		private int direction;
		
		private long time;
	    /**
	     * 执行的指令
	     */
	    private byte cmd;
	    
	    /**
	     * 指令执行情况，0为未知，不知的情况一般是出服务器发出cmd请求，
	     * 如果服务器处理的回复，必须已知了。
	     */
	    private int notifyType = 0;
	    private int transType = 0 ;
	    
	    private String from;
	    private String to;
	    private String pwd="";
		// 数据包体,数据包体是一个json数据包，发送过来的数据需要解析成json
		private String body = "{}";
		private String userId;
		private Timestamp created_at;
		
		
		private int bodysize ;//body 大小
		private int size;
		private boolean send;//发送信息，收到信息
		
		private String sessionid;
		
		public String getSessionid() {
			return sessionid;
		}

		public void setSessionid(String sessionid) {
			this.sessionid = sessionid;
		}

		public int getBodysize() {
			return bodysize;
		}

		public void setBodysize(int bodysize) {
			this.bodysize = bodysize;
		}

		public int getSize() {
			return size;
		}

		public void setSize(int size) {
			this.size = size;
		}

		public boolean isSend() {
			return send;
		}

		public void setSend(boolean send) {
			this.send = send;
		}

		public String getUserId() {
			return userId;
		}

		public String getId() {
			return id;
		}

		public void setId(String id) {
			this.id = id;
		}

		public int getPacketType() {
			return packetType;
		}

		public void setPacketType(int packetType) {
			this.packetType = packetType;
		}

		public int getVersion() {
			return version;
		}

		public void setVersion(int version) {
			this.version = version;
		}

		public int getDirection() {
			return direction;
		}

		public void setDirection(int direction) {
			this.direction = direction;
		}

		public long getTime() {
			return time;
		}

		public void setTime(long time) {
			this.time = time;
		}

		public byte getCmd() {
			return cmd;
		}

		public void setCmd(byte cmd) {
			this.cmd = cmd;
		}

		public int getNotifyType() {
			return notifyType;
		}

		public void setNotifyType(int notifyType) {
			this.notifyType = notifyType;
		}

		public int getTransType() {
			return transType;
		}

		public void setTransType(int transType) {
			this.transType = transType;
		}

		public Timestamp getCreated_at() {
			return created_at;
		}

		public void setCreated_at(Timestamp created_at) {
			this.created_at = created_at;
		}

		public void setUserId(String userId) {
			this.userId = userId;
		}

		public String getFrom() {
			return from;
		}

		public void setFrom(String from) {
			this.from = from;
		}

		public String getTo() {
			return to;
		}

		public void setTo(String to) {
			this.to = to;
		}

		public String getPwd() {
			return pwd;
		}

		public void setPwd(String pwd) {
			this.pwd = pwd;
		}

		public String getBody() {
			return body;
		}

		public void setBody(String body) {
			this.body = body;
		}
		
		
		
}
